class Solution(object):
    def splitString(self, s):
        n = len(s)
        for i in range(1, n):
            last = int(s[:i])
            right = i
            num = 0
            flag = True
            while right < n:
                num = 10 * num + int(s[right])
                if num == last - 1:
                    num = 0
                    if last > 1:
                        last -= 1
                else:
                    if num > last - 1:
                        flag = False
                        break
                    else:
                        if right == n - 1:
                            flag = False
                            break
                right += 1
            if flag:
                return True
        return False


data = Solution()
s = "200100"
print(data.splitString(s))
